<template>
  <div class="page-container">
    <div class="parse">
      <FormParse :template="SXKJ_TEMLATE" :model-data="{}" ref="fromParse"></FormParse>
      <a-button type="primary" @click="getData">获取数据</a-button> 
      <pre style="margin-top: 20px;">
{{ result }}
      </pre>
    </div>
  </div>
</template>

<script setup lang="ts">
import { IFormParseExpose } from '@/components/FormParse/FormParse';
import FormParse from '@/components/FormParse/FormParse.vue';
import { ref } from 'vue';
import { SXKJ_TEMLATE } from './template';
let fromParse = ref<IFormParseExpose>()
let result = ref('')

let getData = () => {
  let data = fromParse.value?.getModelData()
  console.log(data);
  result.value = JSON.stringify(data)
}

</script>

<style scoped lang='scss'>
.parse{
  box-sizing: border-box;
  width: 60%;
  padding: 30px;
}
</style>